package org.jc.subject.application.convert;

import org.jc.subject.application.dto.SubjectCategoryDTO;
import org.jc.subject.application.dto.SubjectLabelDTO;
import org.jc.subject.domain.entity.SubjectCategoryBO;
import org.jc.subject.domain.entity.SubjectLabelBO;
import org.jc.subject.infra.basic.entity.SubjectLabel;
import org.mapstruct.BeanMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 功能描述
 *
 * @author wanghongqian
 * @date 2024/06/18 00:20
 */
@Mapper
public interface SubjectLabelDTOConverter {

    SubjectLabelDTOConverter INSTANCE = Mappers.getMapper(SubjectLabelDTOConverter.class);

    SubjectLabelBO convertDTOToBO(SubjectLabelDTO subjectLabelDTO);

    @Mapping(source = "id",target = "id")
    @BeanMapping(ignoreByDefault = true)
    SubjectLabelBO convertDTOToBOId(SubjectLabelDTO subjectLabelDTO);

    @Mapping(source = "categoryId",target = "categoryId")
    @BeanMapping(ignoreByDefault = true)
    SubjectLabelBO convertDTOToBOCategoryId(SubjectLabelDTO subjectLabelDTO);

    List<SubjectLabelDTO> convertBOToDTOList(List<SubjectLabelBO> subjectLabelBOList);
}
